package com.horoscope.astrology.zodiac.signs.free.dao

import androidx.room.Dao
import androidx.room.Query

/**
 *  作者    1024
 *  时间    2020/4/26 上午9:28
 *  文件    项目备份
 *  描述    数据库访问对象
 */
@Dao
interface QuoteDao {

    @Query("SELECT * FROM quote")
    fun getAll(): List<Quote>

    @Query("SELECT * FROM quote WHERE uid = :id")
    fun getStudentById(id: Int): Quote?

    // 返回从Start开始不包括Start位置的60条数据
    @Query("SELECT * FROM quote limit :start,60")
    fun getIndexForSixtyData(start: Int): MutableList<Quote>

    @Query("SELECT * FROM quote limit 1,60")
    fun getSixtyData(): MutableList<Quote>

    @Query("SELECT * FROM quote limit :start,:num")
    fun getHistoryData(start: Int, num: Int): MutableList<Quote>

}
